﻿<UserControl x:Class="Views.ViewDataImport"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Theme="clr-namespace:OMANE.Common.UI.Theme;assembly=OMANE.Common.UI.Theme"
             xmlns:local="clr-namespace:OMANE.Modules.Indicateurs"
             xmlns:converters="clr-namespace:OMANE.Modules.Indicateurs.Views.Converters">
             <!--DataContext="{Binding Source={x:Static VMtxgar:Locator.ViewModelCmdEncoursImportStatic}}" >-->
    <UserControl.Resources>
        <converters:NomTableConverter x:Key="NomTableConverter" />
        <Theme:StandardIcons x:Key="StandardIcons" />
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="134" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <GroupBox Grid.Row="0"
                  Style="{DynamicResource OMANE_GpeBox}"
                  Header="Choix de la base d'encours" 
                  Name="gbxBaseEnc"
                  Margin="25,25,25,0">
            <Grid  Margin="25,0,25,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" MaxHeight="13" />
                    <RowDefinition Height="57" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" 
                                       Grid.Row="1"
                                       HorizontalAlignment="Left" 
                                       VerticalAlignment="Center"
                                       FontWeight="Regular">
                                Emplacement de la base :
                </TextBlock>
                <Label Grid.Column="1" 
                       Grid.Row="1"
                       BorderBrush="ForestGreen"
                       BorderThickness="1"
                       Margin="10,0,0,0"
                       VerticalContentAlignment="Stretch"
                       VerticalAlignment="Stretch"
                       FontWeight="Regular"
                       Padding="0">
                    <TextBlock VerticalAlignment="Center" 
                               Margin="2,0,0,0"
                               TextWrapping="Wrap"
                               FontWeight="Bold"
                               Text="{Binding TraitementImportEncours.FichierBDD.NomComplet}" />
                </Label>
                <Theme:OMANEbtn Name="BtnParcourir"
                                Margin="10,0,0,0"
                                Grid.Row="1" 
                                Grid.Column="2"
                                Content="Parcourir"
                                Style="{StaticResource btnBase_OMANE_V2}"
                                Icon="{Binding Source={x:Static Theme:StandardIcons.BOUTON_PARCOURIR}}"
                                Command="{Binding Path=cmdParcourir}">
                    <Theme:OMANEbtn.ToolTip>
                        <ToolTip>
                            <TextBlock>Choisir la base de données contenant la table d'encours</TextBlock>
                        </ToolTip>
                    </Theme:OMANEbtn.ToolTip>
                </Theme:OMANEbtn>
                <!--<Button Margin="10,0,0,0" 
                        Grid.Row="1" 
                        Grid.Column="2"
                        Height="23"
                        Width="100"
                        Command="{Binding Path=cmdParcourir}"
                        Name="BtnParcourir">
                    <Button.Template>
                        <ControlTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Margin="4" Source="pack://application:,,,/OMANE.Common.UI.Theme;component/Images/bouton_parcourir.png"/>
                                <TextBlock Margin="2,0,0,0" VerticalAlignment="Center">Parcourir</TextBlock>
                            </StackPanel>
                        </ControlTemplate>
                    </Button.Template>
                </Button>-->
            </Grid>
        </GroupBox>
        <GroupBox Grid.Row="1" 
                  Style="{DynamicResource OMANE_GpeBox}" 
                  Header="Table" 
                  Name="gbxTableBaseEnc"
                  Margin="25,25,25,25">
            <Grid  Margin="25,0,25,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" MaxHeight="13" />
                    <RowDefinition Height="*" MinHeight="25" MaxHeight="38" />
                    <RowDefinition Height="*" MinHeight="25" MaxHeight="38"  />
                    <RowDefinition Height="*" MinHeight="25" MaxHeight="38"  />
                    <RowDefinition Height="*" MaxHeight="13" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Label Grid.Row="1" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Regular">Nom de la table :</Label>
                <Label Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Regular" >Nombre de colonnes :</Label>
                <Label Grid.Row="3" HorizontalAlignment="Left" VerticalAlignment="Center" FontWeight="Regular">Nombre de lignes :</Label>
                <StackPanel Grid.Column="1" HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="1" >
                	<ComboBox 
                		Style="{DynamicResource OMANE_cbx}" 
                		Height="22"
                		SelectedItem="{Binding TraitementImportEncours.NomTableDansBDD, Converter={StaticResource NomTableConverter}, Mode=TwoWay}"
                		ItemsSource="{Binding TraitementImportEncours.ListTablesDispoBDD}" Width="222"/>
                    <Theme:OMANEbtn
                        Style="{StaticResource btnBase_OMANE_V2}"
                		Command="{Binding cmdVisualiser}"
                        Icon="{Binding Source={x:Static Theme:StandardIcons.BOUTON_CONSULTER}}"
                		x:Name="BtnVisualiser" 
                        Content="Visualiser" 
                        HorizontalAlignment="Left"  
                        Margin="15,0,0,0">
                        <Theme:OMANEbtn.ToolTip>
                            <ToolTip>
                                <TextBlock>Visualiser la table d'encours</TextBlock>
                            </ToolTip>
                        </Theme:OMANEbtn.ToolTip>
                    </Theme:OMANEbtn>
                </StackPanel>
                    <Label Height="Auto" Content="{Binding TraitementImportEncours.StatsTable.NbColonnes}" VerticalContentAlignment="Center" Margin="10,0,0,0" Grid.Row="2" Grid.Column="1" />
                    <Label Height="Auto" Content="{Binding TraitementImportEncours.StatsTable.NbLignes}" VerticalContentAlignment="Center" Margin="10,0,0,0" Grid.Row="3" Grid.Column="1" />
            </Grid>
        </GroupBox>     
    </Grid>
</UserControl>
